const mongoose = require("mongoose")
const Schema = mongoose.Schema

// Create Schema
const FoodSchema = new Schema({
  // 菜品ID
  foodId: {
    type: String
  },
  // 菜品类型
  models: {
    type: String,
    required: true
  },
  // 出餐的生产地址
  FoodAddress: {
    type: String,
    required: true
  },
  // 套餐类型
  packageType: {
    type: String,
    required: true
  },
  // 套餐价格
  price: {
    type: String,
    required: true
  },
  // 点餐的人
  name: {
    type: String,
    required: true
  },
  // 点餐人的身份证
  number: {
    type: String,
    required: true
  },
  // 点餐人的电话
  telephone: {
    type: Number,
    required: true
  },
  // 用户的收餐地址
  UserAddress: {
    type: String,
    required: true
  },
  // 订单创建时间
  createTime: {
    type: Date,
    required: true
  },
  endTime:{
    type:Date,
  },
  // 预约菜品的时间线
 CuisineAppointTime: {
    type:Array
  },
  // 点击收到外卖的时间
  opTime:
  {
    type:Date
  },
  // 状态  1 预约成功  2 预约失败
  status: {
    type: Number,
  }
})

module.exports =Food= mongoose.model("foods", FoodSchema);